﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Collections.ObjectModel;

namespace GamePlugin.Logics.Data
{
    public class StateLogData : DependencyObject
    {
        public StateLogData()
        {
            Children = new ObservableCollection<string>();
        }

        public string LastElement
        {
            get
            {
                if (Children.Count > 0)
                    return Children[Children.Count - 1];
                else
                    return "";
            }
        }

        public static readonly DependencyProperty RunStateProperty =
            DependencyProperty.Register("RunState", typeof(string), typeof(StateLogData), 
            new FrameworkPropertyMetadata("運行狀態：空閒",null));
        public string RunState
        {
            get { return (string)GetValue(RunStateProperty); }
            set { SetValue(RunStateProperty, value); }
        }

        public static readonly DependencyProperty ChildrenProperty =
            DependencyProperty.Register("Children", typeof(ObservableCollection<string>), typeof(StateLogData), null);
        public ObservableCollection<string> Children
        {
            get { return (ObservableCollection<string>)GetValue(ChildrenProperty); }
            set { SetValue(ChildrenProperty, value); }
        }
    }
}
